package com.hangup.service;

import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;

/**
 * 后台主service，登录成功了开始启动service，注销登录的时候destroy
 * @author 小贱
 *
 */
public class HangUpMainService extends Service{

	private BroadcastReceiver receiver ;
	
	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}
	
	@Override
	public void onCreate() {
		super.onCreate();
		
	}

    /**
     * 初始化并注册BroadcastReceiver
     */
    private void initBroadcastReceiver(){
    	
    	receiver = new BroadcastReceiver() {
			@Override
			public void onReceive(Context context, Intent intent) {
				/*监听每分钟的广播*/
				if(intent.getAction().equals(Intent.ACTION_TIME_TICK)){
					
				}
			}
		};
		
		IntentFilter filter = new IntentFilter() ;
		filter.addAction(Intent.ACTION_TIME_TICK) ;
		
		registerReceiver(receiver, filter) ;
    }
	
}
